package com.kfyang.manualgear.dao;

import com.kfyang.manualgear.annotation.Dao;
import com.kfyang.manualgear.annotation.crud.Construct;
import com.kfyang.manualgear.annotation.crud.Query;
import com.kfyang.manualgear.entity.PlainEntity;
import com.kfyang.manualgear.struct.Page;
import com.kfyang.manualgear.struct.PageResult;

import java.util.List;

@Dao
public interface ResultDao {

    @Query(col = {"id", "name", "password", "image_url", "role"},
        value = "from plain where id = {id}")
    @Construct("plainCt")
    PlainEntity selectConstruct(int id);

    @Query(col = {"id", "name", "password", "image_url", "role"},
        value = "from plain where id in {{idList}}")
    @Construct("plainCt")
    List<PlainEntity> selectList(List<Integer> idList);

    @Query(col = {"id", "name", "password", "image_url", "role"},
        value = "from plain where id in {{idList}}")
    @Construct("plainCt")
    PageResult<PlainEntity> selectPage(List<Integer> idList, Page page);
}
